<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	</body>
	<script>
		//创造一个类 
		class Star {
			//构造函数
			constructor(name,age) {
			    this.name = name;
				this.age = age;
			}
			sing(song) {
				console.log('唱歌'+song)
			}
		}
		
		//new一个对象
		var Star1 = new Star("小明",18);
		Star1.sing("明天会更好")
		// console.log();
	</script>
</html>
